import request from '@/plugins/request'
import url from '@/plugins/url'
// let ip = 'http://192.168.96.166:5757';
let ip = 'http://localhost:5757';

/**
 * 获取所有模块
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function get_config_all(data) {
  return request({
    url: ip+'/api/build/config_all',
    method: 'POST',
    data: data
  })
}


/**
 * 获取所有权限
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function get_rule_all(data) {
  return request({
    url: ip+'/api/admin/rule_all',
    method: 'POST',
    data: data
  })
}

/**
 * 获取所有权限
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function get_rule_count(data) {
  return request({
    url: ip+'/api/admin/rule_count',
    method: 'POST',
    data: data
  })
}

/**
 * 添加权限
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function add_rule(data) {
  return request({
    url: ip+'/api/admin/rule_add',
    method: 'POST',
    data: data
  })
}

/**
 * 更新权限
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function edit_rule(data) {
  return request({
    url: ip+'/api/admin/rule_edit',
    method: 'POST',
    data: data
  })
}

/**
 * 删除权限
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export function del_rule(data) {
  return request({
    url: ip+'/api/admin/rule_del',
    method: 'POST',
    data: data
  })
}